
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>12.2 Hive Hook＆Bridge · Mantou Book</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="mantou">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="12.3 Sqoop Hook.html" />
    
    
    <link rel="prev" href="12.1 HBase Hook & Bridge.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"mantoudev","repo":"atlas_cn","type":"star","size":"small","count":true}]};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://mantoudev.com" target="_blank" class="custom-link">MantouDev</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">Apache Atlas开发指南(中文版)</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="01.高级架构.html">
            
                <a href="01.高级架构.html">
            
                    
                    一、高级架构​
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="02.类型系统.html">
            
                <a href="02.类型系统.html">
            
                    
                    二、类型系统​
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="03.基本搜索.html">
            
                <a href="03.基本搜索.html">
            
                    
                    三、基本搜索
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="04.高级搜索.html">
            
                <a href="04.高级搜索.html">
            
                    
                    四、高级搜索
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="05.术语.html">
            
                <a href="05.术语.html">
            
                    
                    五、术语​
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="06.安全.html">
            
                <a href="06.安全.html">
            
                    
                    六、安全
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="07.认证.html">
            
                <a href="07.认证.html">
            
                    
                    七、认证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="08.授权模型.html">
            
                <a href="08.授权模型.html">
            
                    
                    八、Atlas授权模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="8.1 简单授权.html">
            
                <a href="8.1 简单授权.html">
            
                    
                    8.1 配置Atlas Simple Authorizer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="8.2 Ranger授权.html">
            
                <a href="8.2 Ranger授权.html">
            
                    
                    8.2 配置Atlas Ranger Authorizer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="09.分类传播.html">
            
                <a href="09.分类传播.html">
            
                    
                    九、分类传播​
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="10.配置Atlas.html">
            
                <a href="10.配置Atlas.html">
            
                    
                    十、配置Atlas属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="11.通知.html">
            
                <a href="11.通知.html">
            
                    
                    十一、通知
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" >
            
                <span>
            
                    
                    十二、Hook & Bridge
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="12.1 HBase Hook & Bridge.html">
            
                <a href="12.1 HBase Hook & Bridge.html">
            
                    
                    12.1 HBase Hook＆Bridge
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.13.2" data-path="12.2 Hive Hook & Bridge.html">
            
                <a href="12.2 Hive Hook & Bridge.html">
            
                    
                    12.2 Hive Hook＆Bridge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="12.3 Sqoop Hook.html">
            
                <a href="12.3 Sqoop Hook.html">
            
                    
                    12.3 Sqoop Hook
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="12.4 Storm Hook.html">
            
                <a href="12.4 Storm Hook.html">
            
                    
                    12.4 Storm Hook
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="12.5 Kafka Bridge.html">
            
                <a href="12.5 Kafka Bridge.html">
            
                    
                    12.5 Kafka Bridge
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="13.容错和高可用选项.html">
            
                <a href="13.容错和高可用选项.html">
            
                    
                    十三、容错和高可用选项
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >12.2 Hive Hook＆Bridge</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#hive-hook--bridge"><b></b>Hive Hook &amp; Bridge</a></li><ul><li><span class="title-icon "></span><a href="#1-hive-&#x6A21;&#x578B;"><b></b>1. Hive &#x6A21;&#x578B;</a></li><li><span class="title-icon "></span><a href="#2-hive-hook"><b></b>2. Hive Hook</a></li><li><span class="title-icon "></span><a href="#3-&#x5217;&#x7EA7;&#x8840;&#x7F18;"><b></b>3. &#x5217;&#x7EA7;&#x8840;&#x7F18;</a></li><ul><li><span class="title-icon "></span><a href="#31-&#x6A21;&#x578B;"><b></b>3.1 &#x6A21;&#x578B;</a></li><li><span class="title-icon "></span><a href="#32-&#x793A;&#x4F8B;"><b></b>3.2 &#x793A;&#x4F8B;</a></li><li><span class="title-icon "></span><a href="#33-&#x4ECE;hive&#x547D;&#x4EE4;&#x4E2D;&#x63D0;&#x53D6;lineage"><b></b>3.3 &#x4ECE;Hive&#x547D;&#x4EE4;&#x4E2D;&#x63D0;&#x53D6;Lineage</a></li></ul><li><span class="title-icon "></span><a href="#4-&#x6CE8;&#x610F;"><b></b>4. &#x6CE8;&#x610F;</a></li><li><span class="title-icon "></span><a href="#5-&#x5BFC;&#x5165;hive&#x5143;&#x6570;&#x636E;"><b></b>5. &#x5BFC;&#x5165;Hive&#x5143;&#x6570;&#x636E;</a></li></ul></ul></div><a href="#hive-hook--bridge" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="hive-hook--bridge"><a name="hive-hook--bridge" class="anchor-navigation-ex-anchor" href="#hive-hook--bridge"><i class="fa fa-link" aria-hidden="true"></i></a><a name="hive-hook--bridge" class="plugin-anchor" href="#hive-hook--bridge"><i class="fa fa-link" aria-hidden="true"></i></a>Hive Hook &amp; Bridge</h1>
<h2 id="1-hive-&#x6A21;&#x578B;"><a name="1-hive-&#x6A21;&#x578B;" class="anchor-navigation-ex-anchor" href="#1-hive-&#x6A21;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="1-hive-&#x6A21;&#x578B;" class="plugin-anchor" href="#1-hive-&#x6A21;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a>1. Hive &#x6A21;&#x578B;</h2>
<p>Hive&#x6A21;&#x578B;&#x5305;&#x542B;&#x4EE5;&#x4E0B;&#x7C7B;&#x578B;(types)&#xFF1A;</p>
<ul>
<li>Entity types:<ul>
<li>hive_db<ul>
<li>super-types: Asset</li>
<li>attributes: qualifiedName, name, description, owner, clusterName, location, parameters, ownerName</li>
</ul>
</li>
<li>hive_table<ul>
<li>super-types: DataSet</li>
<li>attributes: qualifiedName, name, description, owner, db, createTime, lastAccessTime, comment, retention, sd, partitionKeys, columns, aliases, parameters, viewOriginalText, viewExpandedText, tableType, temporary</li>
</ul>
</li>
<li>hive_column<ul>
<li>super-types: DataSet</li>
<li>attributes: qualifiedName, name, description, owner, type, comment, table</li>
</ul>
</li>
<li>hive_storagedesc<ul>
<li>super-types: Referenceable</li>
<li>attributes: qualifiedName, table, location, inputFormat, outputFormat, compressed, numBuckets, serdeInfo, bucketCols, sortCols, parameters, storedAsSubDirectories</li>
</ul>
</li>
<li>hive_process<ul>
<li>super-types: Process</li>
<li>attributes: qualifiedName, name, description, owner, inputs, outputs, startTime, endTime, userName, operationType, queryText, queryPlan, queryId, clusterName</li>
</ul>
</li>
<li>hive_column_lineage<ul>
<li>super-types: Process</li>
<li>attributes: qualifiedName, name, description, owner, inputs, outputs, query, depenendencyType, expression</li>
</ul>
</li>
</ul>
</li>
<li>Enum types:<ul>
<li>hive_principal_type<ul>
<li>values: USER, ROLE, GROUP</li>
</ul>
</li>
</ul>
</li>
<li>Struct types:<ul>
<li>hive_order<ul>
<li>attributes: col, order</li>
</ul>
</li>
<li>hive_serde<ul>
<li>attributes: name, serializationLib, parameters</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>&#x4F7F;&#x7528;&#x552F;&#x4E00;&#x5C5E;&#x6027;qualifiedName&#x5728;Atlas&#x4E2D;&#x521B;&#x5EFA;&#x548C;&#x5220;&#x9664;Hive&#x5B9E;&#x4F53;&#xFF0C;&#x5176;&#x503C;&#x5E94;&#x683C;&#x5F0F;&#x5982;&#x4E0B;&#x6240;&#x8FF0;&#x3002;&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;dbName&#xFF0C;tableName&#x548C;columnName&#x5E94;&#x4E3A;&#x5C0F;&#x5199;&#x3002;</p>
<pre><code>hive_db.qualifiedName:     &lt;dbName&gt;@&lt;clusterName&gt;
   hive_table.qualifiedName:  &lt;dbName&gt;.&lt;tableName&gt;@&lt;clusterName&gt;
   hive_column.qualifiedName: &lt;dbName&gt;.&lt;tableName&gt;.&lt;columnName&gt;@&lt;clusterName&gt;
   hive_process.queryString:  trimmed query string in lower case
</code></pre><h2 id="2-hive-hook"><a name="2-hive-hook" class="anchor-navigation-ex-anchor" href="#2-hive-hook"><i class="fa fa-link" aria-hidden="true"></i></a><a name="2-hive-hook" class="plugin-anchor" href="#2-hive-hook"><i class="fa fa-link" aria-hidden="true"></i></a>2. Hive Hook</h2>
<p>Atlas Hive hook&#x5411;Hive&#x6CE8;&#x518C;&#x4EE5;&#x76D1;&#x542C;&#x521B;&#x5EFA;/&#x66F4;&#x65B0;/&#x5220;&#x9664;&#x64CD;&#x4F5C;&#xFF0C;&#x5E76;&#x901A;&#x8FC7;Kafka&#x901A;&#x77E5;&#x66F4;&#x65B0;Atlas&#x4E2D;&#x7684;&#x5143;&#x6570;&#x636E;&#xFF0C;&#x4EE5;&#x4E86;&#x89E3;Hive&#x4E2D;&#x7684;&#x66F4;&#x6539;&#x3002;&#x6309;&#x7167;&#x4EE5;&#x4E0B;&#x8BF4;&#x660E;&#x5728;Hive&#x4E2D;&#x8BBE;&#x7F6E;Atlas hook&#xFF1A;</p>
<ul>
<li>&#x901A;&#x8FC7;&#x6DFB;&#x52A0;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#x5728;<code>hive-site.xml</code>&#x4E2D;&#x8BBE;&#x7F6E;Atlas hook&#xFF1A;</li>
</ul>
<pre><code>&lt;property&gt;
      &lt;name&gt;hive.exec.post.hooks&lt;/name&gt;
      &lt;value&gt;org.apache.atlas.hive.hook.HiveHook&lt;/value&gt;
    &lt;/property&gt;
</code></pre><ul>
<li>&#x89E3;&#x538B;<code>apache-atlas-${project.version}-hive-hook.tar.gz</code></li>
<li>&#x5C06;&#x6587;&#x4EF6;&#x5939;<code>apache-atlas-hive-hook-${project.version}/hook/hive</code>&#x7684;&#x5168;&#x90E8;&#x5185;&#x5BB9;&#x590D;&#x5236;&#x5230;<code>&lt;atlas package&gt;/hook/hive</code></li>
<li>&#x5728;hive&#x914D;&#x7F6E;&#x7684;<code>hive-env.sh</code>&#x4E2D;&#x6DFB;&#x52A0;&apos;export HIVE_AUX_JARS_PATH=<atlas package="">/hook/hive&apos;</atlas></li>
<li>&#x5C06;<code>`&lt;atlas-conf&gt;/atlas-application.properties</code>&#x590D;&#x5236;&#x5230;hive <code>conf</code>&#x76EE;&#x5F55;&#x3002;</li>
</ul>
<p><code>atlas-application.properties</code>&#x4E2D;&#x7684;&#x4EE5;&#x4E0B;&#x5C5E;&#x6027;&#x63A7;&#x5236;&#x7EBF;&#x7A0B;&#x6C60;&#x548C;&#x901A;&#x77E5;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&#xFF1A;</p>
<pre><code>atlas.hook.hive.synchronous=false # whether to run the hook synchronously. false recommended to avoid delays in Hive query completion. Default: false
atlas.hook.hive.numRetries=3      # number of retries for notification failure. Default: 3
atlas.hook.hive.queueSize=10000   # queue size for the threadpool. Default: 10000

atlas.cluster.name=primary # clusterName to use in qualifiedName of entities. Default: primary

atlas.kafka.zookeeper.connect=                    # Zookeeper connect URL for Kafka. Example: localhost:2181
atlas.kafka.zookeeper.connection.timeout.ms=30000 # Zookeeper connection timeout. Default: 30000
atlas.kafka.zookeeper.session.timeout.ms=60000    # Zookeeper session timeout. Default: 60000
atlas.kafka.zookeeper.sync.time.ms=20             # Zookeeper sync time. Default: 20
</code></pre><p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5728;&#x914D;&#x7F6E;&#x540D;&#x79F0;&#x524D;&#x52A0;&#x4E0A;&#x201C;atlas.kafka&#x201D;&#x524D;&#x7F00;&#x6765;&#x6307;&#x5B9A;Kafka&#x901A;&#x77E5;&#x751F;&#x6210;&#x5668;&#x7684;&#x5176;&#x4ED6;&#x914D;&#x7F6E;&#x3002;&#x6709;&#x5173;Kafka&#x5236;&#x4F5C;&#x4EBA;&#x652F;&#x6301;&#x7684;&#x914D;&#x7F6E;&#x5217;&#x8868;&#xFF0C;&#x8BF7;&#x53C2;&#x9605;<a href="http://kafka.apache.org/documentation/#producerconfigs" target="_blank">Kafka Producer Configs</a>&#x3002;</p>
<h2 id="3-&#x5217;&#x7EA7;&#x8840;&#x7F18;"><a name="3-&#x5217;&#x7EA7;&#x8840;&#x7F18;" class="anchor-navigation-ex-anchor" href="#3-&#x5217;&#x7EA7;&#x8840;&#x7F18;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="3-&#x5217;&#x7EA7;&#x8840;&#x7F18;" class="plugin-anchor" href="#3-&#x5217;&#x7EA7;&#x8840;&#x7F18;"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x5217;&#x7EA7;&#x8840;&#x7F18;</h2>
<p>&#x4ECE;0.8-incubing&#x7248;&#x672C;&#x7684;Atlas&#x5F00;&#x59CB;&#xFF0C;&#x5728;Atlas&#x652F;&#x6301;&#x83B7;&#x53D6;&#x5217;&#x7EA7;&#x8840;&#x7F18;&#x3002;&#x4EE5;&#x4E0B;&#x662F;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&#xFF1A;</p>
<h3 id="31-&#x6A21;&#x578B;"><a name="31-&#x6A21;&#x578B;" class="anchor-navigation-ex-anchor" href="#31-&#x6A21;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="31-&#x6A21;&#x578B;" class="plugin-anchor" href="#31-&#x6A21;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a>3.1 &#x6A21;&#x578B;</h3>
<ul>
<li>ColumnLineageProcess&#x7C7B;&#x578B;&#x662F;Process&#x7684;&#x5B50;&#x7C7B;&#x578B;</li>
<li>&#x8FD9;&#x5C06;&#x8F93;&#x51FA;&#x5217;&#x4E0E;&#x4E00;&#x7EC4;&#x8F93;&#x5165;&#x5217;&#x6216;&#x8F93;&#x5165;&#x8868;&#x76F8;&#x5173;&#x8054;</li>
<li>&#x8840;&#x7F18;&#x4FE1;&#x606F;&#x4E5F;&#x6355;&#x83B7;&#x4E86;&#x4F9D;&#x8D56;&#x6027;&#xFF0C;&#x5982;&#x4E0B;&#x6240;&#x793A;&#xFF1A;<ul>
<li>SIMPLE&#xFF1A;&#x8F93;&#x51FA;&#x5217;&#x4E0E;&#x8F93;&#x5165;&#x503C;&#x76F8;&#x540C;</li>
<li>EXPRESSION&#xFF1A;&#x8F93;&#x51FA;&#x5217;&#x5728;&#x8F93;&#x5165;&#x5217;&#x7684;&#x8FD0;&#x884C;&#x65F6;&#xFF08;&#x4F8B;&#x5982;&#xFF0C;Hive SQL&#x8868;&#x8FBE;&#x5F0F;&#xFF09;&#x7531;&#x67D0;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#x8F6C;&#x6362;&#x3002;</li>
<li>SCRIPT&#xFF1A;&#x8F93;&#x51FA;&#x5217;&#x7531;&#x7528;&#x6237;&#x63D0;&#x4F9B;&#x7684;&#x811A;&#x672C;&#x8F6C;&#x6362;&#x3002;</li>
</ul>
</li>
<li>&#x5728;EXPRESSION&#x4F9D;&#x8D56;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;expression&#x5C5E;&#x6027;&#x5305;&#x542B;&#x5B57;&#x7B26;&#x4E32;&#x5F62;&#x5F0F;&#x7684;&#x8868;&#x8FBE;&#x5F0F;</li>
<li>&#x7531;&#x4E8E;Process&#x94FE;&#x63A5;&#x8F93;&#x5165;&#x548C;&#x8F93;&#x51FA;DataSet&#xFF0C;&#x56E0;&#x6B64;Column&#x662F;DataSet&#x7684;&#x5B50;&#x7C7B;&#x578B;</li>
</ul>
<h3 id="32-&#x793A;&#x4F8B;"><a name="32-&#x793A;&#x4F8B;" class="anchor-navigation-ex-anchor" href="#32-&#x793A;&#x4F8B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="32-&#x793A;&#x4F8B;" class="plugin-anchor" href="#32-&#x793A;&#x4F8B;"><i class="fa fa-link" aria-hidden="true"></i></a>3.2 &#x793A;&#x4F8B;</h3>
<p>&#x4E0B;&#x9762;&#x662F;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;CTAS&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code>create table t2 as select id, name from T1
</code></pre><p>&#x6355;&#x83B7;&#x5230;&#x7684;&#x8840;&#x7F18;&#x5982;&#x4E0B;&#xFF1A;
<img src="https://atlas.apache.org/images/column_lineage_ex1.png" alt="column_lineage_ex1"></p>
<h3 id="33-&#x4ECE;hive&#x547D;&#x4EE4;&#x4E2D;&#x63D0;&#x53D6;lineage"><a name="33-&#x4ECE;hive&#x547D;&#x4EE4;&#x4E2D;&#x63D0;&#x53D6;lineage" class="anchor-navigation-ex-anchor" href="#33-&#x4ECE;hive&#x547D;&#x4EE4;&#x4E2D;&#x63D0;&#x53D6;lineage"><i class="fa fa-link" aria-hidden="true"></i></a><a name="33-&#x4ECE;hive&#x547D;&#x4EE4;&#x4E2D;&#x63D0;&#x53D6;lineage" class="plugin-anchor" href="#33-&#x4ECE;hive&#x547D;&#x4EE4;&#x4E2D;&#x63D0;&#x53D6;lineage"><i class="fa fa-link" aria-hidden="true"></i></a>3.3 &#x4ECE;Hive&#x547D;&#x4EE4;&#x4E2D;&#x63D0;&#x53D6;Lineage</h3>
<ul>
<li>HiveHook&#x5C06;HookContext&#x4E2D;&#x7684;LineageInfo&#x6620;&#x5C04;&#x5230;Column lineage&#x5B9E;&#x4F8B;</li>
<li>Hive&#x4E2D;&#x7684;LineageInfo&#x4E3A;&#x6700;&#x7EC8;&#x7684;FileSinkOperator&#x63D0;&#x4F9B;&#x5217;&#x7EA7;&#x522B;&#x7684;&#x8840;&#x7F18;&#xFF0C;&#x5C06;&#x5B83;&#x4EEC;&#x94FE;&#x63A5;&#x5230;Hive&#x67E5;&#x8BE2;&#x4E2D;&#x7684;&#x8F93;&#x5165;&#x5217;</li>
</ul>
<h2 id="4-&#x6CE8;&#x610F;"><a name="4-&#x6CE8;&#x610F;" class="anchor-navigation-ex-anchor" href="#4-&#x6CE8;&#x610F;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="4-&#x6CE8;&#x610F;" class="plugin-anchor" href="#4-&#x6CE8;&#x610F;"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x6CE8;&#x610F;</h2>
<ul>
<li>&#x5728;&#x5C06;HIVE-13112&#x7684;&#x4FEE;&#x8865;&#x7A0B;&#x5E8F;&#x5E94;&#x7528;&#x4E8E;Hive&#x6E90;&#x4E4B;&#x540E;&#xFF0C;&#x5217;&#x7EA7;&#x522B;&#x8C31;&#x7CFB;&#x4E0E;Hive&#x7248;&#x672C;1.2.1&#x4E00;&#x8D77;&#x4F7F;&#x7528;</li>
<li>&#x7531;&#x4E8E;&#x6570;&#x636E;&#x5E93;&#x540D;&#x79F0;&#xFF0C;&#x8868;&#x540D;&#x79F0;&#x548C;&#x5217;&#x540D;&#x79F0;&#x5728;&#x914D;&#x7F6E;&#x5355;&#x5143;&#x4E2D;&#x4E0D;&#x533A;&#x5206;&#x5927;&#x5C0F;&#x5199;&#xFF0C;&#x56E0;&#x6B64;&#x5B9E;&#x4F53;&#x4E2D;&#x7684;&#x76F8;&#x5E94;&#x540D;&#x79F0;&#x662F;&#x5C0F;&#x5199;&#x7684;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x5728;&#x67E5;&#x8BE2;&#x5B9E;&#x4F53;&#x540D;&#x79F0;&#x65F6;&#xFF0C;&#x4EFB;&#x4F55;&#x641C;&#x7D22;API&#x90FD;&#x5E94;&#x4F7F;&#x7528;&#x5C0F;&#x5199;</li>
<li>&#x5F53;&#x524D;&#x7531;hive hook&#x6355;&#x83B7;&#x4EE5;&#x4E0B;&#x914D;&#x7F6E;&#x5355;&#x5143;&#x64CD;&#x4F5C;<ul>
<li>create database</li>
<li>create table/view, create table as select</li>
<li>load, import, export</li>
<li>DMLs&#xFF08;insert&#xFF09;</li>
<li>alter database</li>
<li>alter table&#xFF08;&#x503E;&#x659C;&#x7684;&#x8868;&#x4FE1;&#x606F;&#xFF0C;&#x5B58;&#x50A8;&#x4E3A;&#xFF0C;&#x4E0D;&#x652F;&#x6301;&#x4FDD;&#x62A4;&#xFF09;</li>
<li>alter view</li>
</ul>
</li>
</ul>
<h2 id="5-&#x5BFC;&#x5165;hive&#x5143;&#x6570;&#x636E;"><a name="5-&#x5BFC;&#x5165;hive&#x5143;&#x6570;&#x636E;" class="anchor-navigation-ex-anchor" href="#5-&#x5BFC;&#x5165;hive&#x5143;&#x6570;&#x636E;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="5-&#x5BFC;&#x5165;hive&#x5143;&#x6570;&#x636E;" class="plugin-anchor" href="#5-&#x5BFC;&#x5165;hive&#x5143;&#x6570;&#x636E;"><i class="fa fa-link" aria-hidden="true"></i></a>5. &#x5BFC;&#x5165;Hive&#x5143;&#x6570;&#x636E;</h2>
<p>Apache Atlas&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x547D;&#x4EE4;&#x884C;&#x811A;&#x672C;<code>import-hive.sh</code>&#xFF0C;&#x7528;&#x4E8E;&#x5C06;Apache Hive&#x6570;&#x636E;&#x5E93;&#x548C;&#x8868;&#x7684;&#x5143;&#x6570;&#x636E;&#x5BFC;&#x5165;Apache Atlas&#x3002;&#x8BE5;&#x811A;&#x672C;&#x53EF;&#x7528;&#x4E8E;&#x4F7F;&#x7528;Apache Hive&#x4E2D;&#x7684;&#x6570;&#x636E;&#x5E93;/&#x8868;&#x521D;&#x59CB;&#x5316;Apache Atlas&#x3002;&#x6B64;&#x811A;&#x672C;&#x652F;&#x6301;&#x5BFC;&#x5165;&#x7279;&#x5B9A;&#x8868;&#x7684;&#x5143;&#x6570;&#x636E;&#xFF0C;&#x7279;&#x5B9A;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x7684;&#x8868;&#x6216;&#x6240;&#x6709;&#x6570;&#x636E;&#x5E93;&#x548C;&#x8868;&#x3002;</p>
<pre><code>Usage 1: &lt;atlas package&gt;/hook-bin/import-hive.sh
Usage 2: &lt;atlas package&gt;/hook-bin/import-hive.sh [-d &lt;database regex&gt; OR --database &lt;database regex&gt;] [-t &lt;table regex&gt; OR --table &lt;table regex&gt;]
Usage 3: &lt;atlas package&gt;/hook-bin/import-hive.sh [-f &lt;filename&gt;]
           File Format:
             database1:tbl1
             database1:tbl2
             database2:tbl1
</code></pre>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="12.1 HBase Hook & Bridge.html" class="navigation navigation-prev " aria-label="Previous page: 12.1 HBase Hook＆Bridge">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="12.3 Sqoop Hook.html" class="navigation navigation-next " aria-label="Next page: 12.3 Sqoop Hook">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"12.2 Hive Hook＆Bridge","level":"1.13.2","depth":2,"next":{"title":"12.3 Sqoop Hook","level":"1.13.3","depth":2,"path":"12.3 Sqoop Hook.md","ref":"12.3 Sqoop Hook.md","articles":[]},"previous":{"title":"12.1 HBase Hook＆Bridge","level":"1.13.1","depth":2,"path":"12.1 HBase Hook & Bridge.md","ref":"12.1 HBase Hook & Bridge.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","splitter","-expandable-chapters-small","anchors","github","github-buttons","donate","sharing-plus","anchor-navigation-ex","-favicon","ga","disqus"],"styles":{"website":"/styles/website.css"},"pluginsConfig":{"disqus":{"useIdentifier":false,"shortName":"mantoudev"},"github":{"url":"https://github.com/mantoudev"},"splitter":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"donate":{"alipay":"https://mantoudev.com/images/alipay.jpg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"https://mantoudev.com/images/wechatpay.jpg","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":false},"github-buttons":{"buttons":[{"user":"mantoudev","repo":"atlas_cn","type":"star","size":"small","count":true}]},"ga":{"configuration":"auto","token":"UA-129870378-1"},"sharing":{"qq":false,"all":["google","facebook","weibo","twitter","qq","qzone","linkedin","pocket"],"douban":false,"facebook":false,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"theme":"default","author":"mantou","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Mantou Book","language":"zh-hans","links":{"sidebar":{"MantouDev":"https://mantoudev.com"}},"gitbook":"3.2.3","description":"吭哧吭哧"},"file":{"path":"12.2 Hive Hook & Bridge.md","mtime":"2018-12-01T13:48:51.460Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-12-02T09:34:36.806Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-ga/plugin.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

